/*
 * Delta.java
 * 
 * Copyright 2011 Matt Whipple <matt@mattwhipple.com>
 * 
 * This file is part of com.teamsuperfitness.apps
 * 
 * com.teamsuperfitness.apps is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your option)
 * any later version.
 * 
 * com.teamsuperfitness.apps is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with com.teamsuperfitness.apps. If not, see http://www.gnu.org/licenses/.
 */

package com.teamsuperfitness.apps.shared.model;

import java.io.Serializable;
import java.util.Date;

import com.teamsuperfitness.apps.shared.model.roles.Entifiable;

@SuppressWarnings("serial")
public class Delta implements Serializable {

    Long id;
    Date timestamp;
    String content;

    private String parentKind;
    private Long parentId;

    public Delta(String diff, Entifiable parent) {
        this.timestamp = new Date();
        this.content = diff;
        this.setParentKind(parent.getKind());
        this.setParentId(parent.getId());
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }

    public String getContent() {
        return this.content;
    }

    /**
     * @return the parentKind
     */
    public String getParentKind() {
        return parentKind;
    }

    /**
     * @param parentKind the parentKind to set
     */
    public void setParentKind(String parentKind) {
        this.parentKind = parentKind;
    }

    /**
     * @return the parentId
     */
    public Long getParentId() {
        return parentId;
    }

    /**
     * @param parentId the parentId to set
     */
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

}
